<!DOCTYPE html>
<html lang="en">
<head>
  <{include file="public_html/header_tag.html"}>
    <title>直播课详情</title>

</head>
<body>
<script>
var iframe_index;
$(function () {
  $("#buy_now").click(function(){
    is_login = <{$logged_in}>;
    if(is_login > 0){
        $("#buy_form").submit();
    }else{
      //login/iframe
       iframe_index = layer.open({
       type: 2,
       area: ['420px', '430px'],
       fixed: false, //不固定
       maxmin: false,
       shadeClose: true,
        title: false,
       content: ['/login/iframe', 'no']
     });

    }
  });

})

function login_success(){
  parent.layer.close(iframe_index);
  window.location.href=window.location.href;
  window.location.reload;
}
</script>
<div class="wrap">
	<!--star header-->
    <div class="header">
		<{include file="public_html/header_menu.html"}>
    </div>
	<!--end  header-->

  <div class="return_nav">
    <div class="w1200">
      您的位置：<a href="/">首页</a><span>&gt;</span><a href="/live">直播列表</a><span>&gt;</span><em>直播详情</em>
      </div>
  </div>
<!--star main-->
  <div class="wrap_main fix">
      <!--content star-->
      <div class="col_main">
          <!--star-->
          <div class="box_item m-t10">
            <div class="fix line-all b-FFFFFF p15">
                  <!--star-->
                  <div class="l" style="width:450px; padding-right:80px;">
                      <div>
                          <div class="img450330"><img src="<{$info.course_img}>"></div>
                      </div>
                  </div>
                  <!--end-->
                  <!--star-->
                  <div class="l LH40 shipdetails" style="width:390px;">
                      <div class="fs26 p-t10"><{$info.title}></div>
                      <div class="fs14 LH30 info p-t10">
                        <ul class="wList50">
                            <li><span class="tit">价格：</span><span class="c-FF0000">¥<em class="fs20"><{$info.price}></em></span></li>
                            <li><span class="tit">主讲老师：</span><span><{$info.teacher_name}></span></li>
                            <li><span class="tit">满意度</span><span><{if $info.comment_count == 0}>100%<{else}><{(($info.star4+$info.star5)/$info.comment_count*100)|string_format:'%.0f'}>%<{/if}></span></li>
                            <li><span class="tit">总课时</span><span><{$info.course_time}>课时</span></li>
                          </ul>
                          <div class="h30 c p-tb5"></div>
                          <div class="h30 c p-tb5 hide"><span class="tit">机构</span><span><{$info.school_name}></span></div>
                          <div class="line-bottom2 p-b5 m-b5"></div>
                          <div class="ibtn LH50 p-tb15 fs20">
                              <form action="/order/buy_now" id="buy_form" method="post">
                                <input type="hidden" name="course_id" value="<{$info.id}>" />
                                <input type="hidden" name="num" value="1" />
                              </form>
                              
                            <{if $live_status == 1}>
                              <{if $is_buy == 1}>
                              <a href="/live/play/<{$info.id}>">课程观看</a>
                              <{else}>
                              <a href="javascript:;" id="buy_now">立即购买</a>
                              <{/if}>
                            <{else}>
                            <a href="javascript:;">已结束</a>
                            <{/if}>
                          </div>
                          <div class="">
                            <a  href="javascript:;" id="is_collect" onclick="collect(<{$info.id}>,2);" ><{if $info.is_collect == 1}>已收藏<{else}>收藏<{/if}></a>
                              <span style="padding:0 25px;">&nbsp;</span>
                              <a href="javascript:;">分享</a>
                          </div>
                      </div>
                  </div>
                  <!--end-->
              </div>
          </div>
          <!--end-->
          <!--star-->
          <div class="box_item m-t40">
            <div class="fix line-all b-FFFFFF shipincons">
                <div class="mt fs16">
                    <a class="curr" href="#A">课程介绍</a>
                    <a href="#B">课程详情</a>
                    <a href="#C">课程评价</a>
                  </div>
                  <div class="mc fix p25">
                    <!--star课程介绍 -->
                    <div class="fix">
                        <a name="A"></a>
                          <div class="con t_form fs14">
                              <table width="100%">
                                  <colgroup>
                                      <col width="15%">
                                      <col width="75%">
                                  </colgroup>
                                  <tr>
                                      <td class="tdtit tac"><span>适用人群</span></td>
                                      <td><{$info.suitable}></td>
                                  </tr>
                                  <tr>
                                      <td class="tdtit tac"><span>教学老师</span></td>
                                      <td>
                                          <dl class="fix p-tb15">
                                              <dt class="ith_img img7070 m-r20 l"><img src="<{$info.header_img}>"></dt>
                                              <dd class="LH20 l" style="width:500px;">
                                                    <div class="fs16 p-tb10"><{$info.teacher_name}></div>
                                                    <div class="l c-666666"><{$info.intro}></div>
                                              </dd>
                                          </dl>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td class="tdtit tac"><span>课程收益</span></td>
                                      <td>
                                      <div class="LH30 p-tb20">
                                        <{$info.learn_what}>
                                      </div>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td class="tdtit tac"><span>课程介绍</span></td>
                                      <td>
                                      <div class="LH30 p-tb20">
                                        <p><{$info.detail}></p>
                                      </div>
                                      </td>
                                  </tr>
                              </table>

                          </div>
                      </div>
                    <!--end课程介绍 -->
                    <!--star课程详情 -->
                    <div class="fix p-t20 s_kcmulu">
                        <a name="B"></a>
                          <div class="con t_form fs14">
                            <table width="100%">
                                  <colgroup>
                                      <col width="100%">
                                  </colgroup>
                                  <tbody>
                                  <tr>
                                      <th class="tdtit tal"><span class="fs16 c-333333">课程详情</span></th>
                                  </tr>
                                  <tr>
                                    <td class="tac">
                                    <{$info.detail}>
                                    </td>
                                  </tr>
                                  </tbody>
                              </table>

                          </div>
                      </div>
                    <!--end课程详情 -->
                    <!--star课程评价 -->
                    <div class="fix p-t20 s_kcmulu">
                          <a name="C"></a>
                            <div class="con t_form fs14">
                              <table width="100%">
                                    <colgroup>
                                        <col width="10%">
                                        <col width="75%">
                                        <col width="15%">
                                    </colgroup>
                                    <tbody>
                                    <tr>
                                        <th colspan="2" class="tdtit tal"><span class="fs16 c-333333">课程评价<span class="c-ff5215 p-l10">(<{$info.comment_count}>)</span></span></th>
                                    </tr>
                                    <tr>
                                      <td class="tac LH50">
                                          <div class="p30">
                                                <div class="p-lr50">
                                                    <div class="c-ff5215" style="font-size:50px;"><{if $info.comment_count == 0}>100%<{else}><{(($info.star4+$info.star5)/$info.comment_count*100)|string_format:'%.0f'}>%<{/if}></div>
                                                    <div class="fs16 c-999999">满意度</div>
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                          <div class="p30 fs14 s_pinjialist">
                                            <ul>
                                                <li class="item">
                                                    <div class="tit l"><span>1星</span><span class="c-999999 p-l10">(<{$info.star1}>)</span></div>
                                                    <div class="progressBar m-t10 l">
                                                        <div class="subBar" style="width:<{if $info.comment_count > 0}><{($info.star1/$info.comment_count*100)|string_format:'%.0f'}><{else}>0<{/if}>%"></div>
                                                    </div>
                                                </li>
                                                <li class="item">
                                                    <div class="tit l"><span>2星</span><span class="c-999999 p-l10">(<{$info.star2}>)</span></div>
                                                    <div class="progressBar m-t10 l">
                                                        <div class="subBar" style="width:<{if $info.comment_count > 0}><{($info.star2/$info.comment_count*100)|string_format:'%.0f'}><{else}>0<{/if}>%"></div>
                                                    </div>
                                                </li>
                                                <li class="item">
                                                    <div class="tit l"><span>3星</span><span class="c-999999 p-l10">(<{$info.star3}>)</span></div>
                                                    <div class="progressBar m-t10 l">
                                                        <div class="subBar" style="width:<{if $info.comment_count > 0}><{($info.star3/$info.comment_count*100)|string_format:'%.0f'}><{else}>0<{/if}>%"></div>
                                                    </div>
                                                </li>
                                                <li class="item">
                                                    <div class="tit l"><span>4星</span><span class="c-999999 p-l10">(<{$info.star4}>)</span></div>
                                                    <div class="progressBar m-t10 l">
                                                        <div class="subBar" style="width:<{if $info.comment_count > 0}><{($info.star4/$info.comment_count*100)|string_format:'%.0f'}><{else}>0<{/if}>%"></div>
                                                    </div>
                                                </li>
                                                <li class="item">
                                                    <div class="tit l"><span>5星</span><span class="c-999999 p-l10">(<{$info.star5}>)</span></div>
                                                    <div class="progressBar m-t10 l">
                                                        <div class="subBar" style="width:<{if $info.comment_count > 0}><{($info.star5/$info.comment_count*100)|string_format:'%.0f'}><{else}>0<{/if}>%"></div>
                                                    </div>
                                                </li>
                                            </ul>
                                            </div>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="fix c m-t20">
                              <div class="line-all fs14 s_pingNeirong">
                                  <div class="mt tabBar">
                                      <span class="tit"><input type="radio" class="show_comment" star="" checked="" name='s'><label><i class="ico_radio"></i>全部</label></span>
                                      <span class="tit"><input type="radio" class="show_comment" star="1" name='s'><label><i class="ico_radio"></i>好评</label></span>
                                      <span class="tit"><input type="radio" class="show_comment" star="2" name='s'><label><i class="ico_radio"></i>中评</label></span>
                                      <span class="tit"><input type="radio" class="show_comment" star="3" name='s'><label><i class="ico_radio"></i>差评</label></span>
                                    </div>
                                    <div class="mc fix tabCon">
                                        <!--star 全部-->
                                        <div class="divitem iframe" style="display: block;">
                                            <iframe name="myiframe" id="myiframe" onLoad="iFrameHeight('myiframe')" width="100%" height="100%" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="/video/video_comment_list/<{$info.id}>"></iframe>
                                        </div>
                                        <!--end 全部-->
                                        <!--star 好评-->
                                        <div class="divitem iframe1">
                                            <iframe name="myiframe" id="myiframe1" onLoad="iFrameHeight('myiframe1')" width="100%" height="100%" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="/video/video_comment_list/<{$info.id}>/1"></iframe>
                                        </div>
                                        <!--end 好评-->
                                        <!--star 中评-->
                                        <div class="divitem iframe2">
                                            <iframe name="myiframe" id="myiframe2" onLoad="iFrameHeight('myiframe2')" width="100%" height="100%" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="/video/video_comment_list/<{$info.id}>/2"></iframe>
                                        </div>
                                        <!--end 中评-->
                                        <!--star 差评-->
                                        <div class="divitem iframe3">
                                            <iframe name="myiframe" id="myiframe3" onLoad="iFrameHeight('myiframe3')" width="100%" height="100%" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="/video/video_comment_list/<{$info.id}>/3"></iframe>
                                        </div>
                                        <!--end 差评-->
                                    </div>

                                </div>

                            </div>
                            <!--star分页-->
                            <div class="pages m-tb40">
                                <ul>
                                   <!--  <li><span>&lt;</span></li>
                                    <li><a href="">1</a></li>
                                    <li class="curr"><a href="">2</a></li>
                                    <li><a href="">3</a></li>
                                    <li><span>&gt;</span></li>
                                    <li>100 条 2/4 页</li> -->
                                </ul>
                            </div>
                            <!--end分页-->
                        </div>
                    <!--end课程评价 -->
                  </div>
              </div>
          </div>
          <!--end-->
          <div class="fix" style="height:90px;"></div>
      </div>
      <!--content end-->
  </div>
<!--end  main-->
    <!--star  footer-->
    <div class="footer b-FFFFFF">
    <{include file="public_html/footer.html"}>
    </div>
    <!--end  footer-->
</div>
</body>
<script type="text/javascript">
var is_login = "<{$user_data.id|default:0}>";
function collect(id,type){
  if(is_login > 0){
    $.ajax({
    type: "POST",
    url:  "/live/collect",
    data: "id="+id+"&type="+type,
    async: false,
    dataType: "json",
    success: function(data){
        if(data == 1){
          $("#is_collect").text('已收藏');
        }
        if(data == 2){
          alert("已经收藏过了！");
        }
      }
    });
  }else{
    alert("请先登录");
  }
  
}
</script>
<script>
    $(function(){
        $(".show_comment").click(function(){
            var star  = $(this).attr("star");
            $(".divitem").hide();
            $(".iframe"+star).show();
        })
    })
    function iFrameHeight(iframe_id) {   
        var ifm= document.getElementById(iframe_id);   
        var subWeb = document.frames ? document.frames[iframe_id].document : ifm.contentDocument;
        if(ifm != null && subWeb != null) {
           ifm.height = subWeb.body.scrollHeight;
           ifm.width = subWeb.body.scrollWidth;
        }   
    }
</script>
</html>
